Conversation
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
dbraquart
left a comment
There was a problem hiding this comment.
code: 2 types for modification vs map ?
tests: error on 2WT creation ?
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
...nts/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: achour94 <berrahmaachour@gmail.com>
Signed-off-by: achour94 <berrahmaachour@gmail.com>
…twt-creation # Conflicts: # src/components/dialogs/network-modifications/two-windings-transformer/characteristics-pane/two-windings-transformer-characteristics-pane.tsx # src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog-header.tsx # src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog.tsx # src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.tsx
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
dbraquart
left a comment
There was a problem hiding this comment.
code: some changes to adress please
tests: ok (so far)
| connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]), | ||
| connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]), |
There was a problem hiding this comment.
| connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]), | |
| connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]), | |
| connectionPosition1: characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION], | |
| connectionPosition2: characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION], |
And connectionPosition1/connectionPosition2 should be typed number rather than string in TwoWindingsTransformerCreationInfo
| connectionPosition1: String(characteristics[CONNECTIVITY_1]?.[CONNECTION_POSITION]), | ||
| connectionPosition2: String(characteristics[CONNECTIVITY_2]?.[CONNECTION_POSITION]), | ||
| connected1: Boolean(characteristics[CONNECTIVITY_1]?.[CONNECTED]), | ||
| connected2: Boolean(characteristics[CONNECTIVITY_2]?.[CONNECTED]), |
There was a problem hiding this comment.
either we cast, or we change the type as "boolean | null" ... dont know.
Casting is always a "force" move. And Boolean(null) == false.
But in our case it does not matter because there is always a value in the form for the connection boolean (I think).
| currentNode: CurrentTreeNode; | ||
| currentRootNetworkUuid: UUID; | ||
| isUpdate?: boolean; | ||
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; |
There was a problem hiding this comment.
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; | |
| editDataFetchStatus?: FetchStatus; |
| currentRootNetworkUuid: UUID; | ||
| isUpdate?: boolean; | ||
| editData?: TwoWindingsTransformerModificationInfo; | ||
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; |
There was a problem hiding this comment.
| editDataFetchStatus?: (typeof FetchStatus)[keyof typeof FetchStatus]; | |
| editDataFetchStatus?: FetchStatus; |
using enum type from services/utils.type
| const [dataFetchStatus, setDataFetchStatus] = useState<(typeof FetchStatus)[keyof typeof FetchStatus]>( | ||
| FetchStatus.IDLE | ||
| ); |
There was a problem hiding this comment.
| const [dataFetchStatus, setDataFetchStatus] = useState<(typeof FetchStatus)[keyof typeof FetchStatus]>( | |
| FetchStatus.IDLE | |
| ); | |
| const [dataFetchStatus, setDataFetchStatus] = useState<FetchStatus>(FetchStatus.IDLE); |
| ) | ||
| : null, | ||
| targetV: getValueOrDefault(TARGET_V), | ||
| targetDeadband: getValueOrDefault(TARGET_DEADBAND), |
There was a problem hiding this comment.
targetV/targetDeadband are already in ...ratioTapChangerFormValues
| regulationType: getValueOrDefault(REGULATION_TYPE), | ||
| }; | ||
| } | ||
| let phaseTap = undefined; |
There was a problem hiding this comment.
same, we should type ?
let phaseTap: PhaseTapChangerCreationInfos | null = null;
rather than casting further
I tried, and attributes are missing ...
| disabled?: boolean; | ||
| previousValues?: RatioTapChangerData; | ||
| previousValues?: TapChangerMapInfos; | ||
| editData?: Record<string, unknown>; |
There was a problem hiding this comment.
| editData?: Record<string, unknown>; | |
| editData?: TwoWindingsTransformerModificationInfo; |
| <RatioTapChangerPaneSteps | ||
| disabled={!ratioTapChangerEnabledWatcher} | ||
| previousValues={previousValues?.ratioTapChanger} | ||
| editData={editData?.ratioTapChanger as Record<string, unknown> | undefined} |
There was a problem hiding this comment.
| editData={editData} |
| connectivity1?: Record<string, unknown> | null; | ||
| connectivity2?: Record<string, unknown> | null; |
There was a problem hiding this comment.
| connectivity1?: Record<string, unknown> | null; | |
| connectivity2?: Record<string, unknown> | null; | |
| connectivity1?: ConnectivityFormSchema | null; | |
| connectivity2?: ConnectivityFormSchema | null; |
|



PR Summary